package org.gdgbologna.resources;

import java.util.Calendar;

import android.os.Parcel;
import android.os.Parcelable;

public class Talk implements Parcelable{

	String title;
	String time;
	String speaker;
	String aula;
	String color;
	String abstra;
	Calendar start;
	Calendar end;
	long id;

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(id);
		dest.writeString(title);
		dest.writeString(time);
		dest.writeString(speaker);
		dest.writeString(aula);
		dest.writeString(color);
		dest.writeString(abstra);
	//	dest.writeValue(start);
	//	dest.writeValue(end);
	}

	public Talk (Parcel in) {
		id = in.readLong();
		title = in.readString();
		time = in.readString();
		speaker = in.readString();
		aula = in.readString();
		color = in.readString();
		abstra = in.readString();
	}


	public Talk(long _id){
		id = _id;
		this.abstra = "";
	}

	public long getId(){
		return id;
	}

	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTime() {
		return time;
	}
	public void setTime(String time) {
		this.time = time;
	}
	public String getSpeaker() {
		return speaker;
	}
	public void setSpeaker(String speaker) {
		this.speaker = speaker;
	}
	public String getAula() {
		return aula;
	}
	public void setAula(String aula) {
		this.aula = aula;
	}

	public String toString(){
		return title;
	}

	public String getColor() {
		if (color != null) return color;
		else return "BLACK";
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getAbstra() {
		return abstra;
	}

	public void setAbstra(String abstra) {
		this.abstra = abstra;
	}

	public Calendar getStart() {
		return start;
	}

	public void setStart(Calendar start) {
		this.start = start;
	}

	public Calendar getEnd() {
		return end;
	}

	public void setEnd(Calendar end) {
		this.end = end;
	}



	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	public static final Parcelable.Creator<Talk> CREATOR = new Parcelable.Creator<Talk>() {

		public Talk createFromParcel(Parcel source) {
			return new Talk(source);
		}

		@Override
		public Talk[] newArray(int size) {
			// TODO Auto-generated method stub
			return new Talk[size];
		}

	};


}
